package com.lhkj.ct.meta.admin.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lhkj.ct.base.enums.DataScope;
import com.lhkj.ct.base.enums.GlobalStatus;
import com.lhkj.ct.base.mybatis.IBaseEntity;
import com.lhkj.ct.base.validator.group.ValGroups;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 *      角色管理
 * </p>
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="TblRole对象", description="角色管理")
@TableName("tbl_role")
public class TblRole implements IBaseEntity<String> {

    private static final long serialVersionUID = 1L;

    @NotBlank(message = "角色id不能为空", groups = {ValGroups.Update.class})
    @ApiModelProperty(value = "主键")
    private String id;

    @NotBlank(message = "请输入角色名称", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 50, message = "角色名称不能超过{max}字", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色名称")
    private String name;

    @NotBlank(message = "请输入角色编码", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @Length(max = 15, message = "角色编码不能超过{max}字", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色编码")
    private String code;

    @NotNull(message = "请选择可查看的数据权限", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "数据权限")
    private DataScope dataScope;

    @NotNull(message = "请选择角色状态", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "角色状态", allowableValues = "0或1", notes = "0.正常 1.禁用")
    private GlobalStatus status;

    @ApiModelProperty(value = "角色备注")
    private String note;

    @NotNull(message = "请输入排序", groups = {ValGroups.Insert.class, ValGroups.Update.class})
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;


}
